package com.liujiajin.controller;

import com.liujiajin.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 评论Controller
 */
@RequestMapping("/test")
@RestController
@Slf4j
public class TestController {

    @Autowired
    private IUserService userService;

    @RequestMapping(value = "/query",method = RequestMethod.GET)
    public String query(){
        log.info("查询用户总人数");
        // 查询用户总人数
        int userTotal = userService.countUserTotal();
        return "用户总人数：" + userTotal;
    }
}
